﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Runtime.Serialization;

namespace WcfService.DTO
{
    [DataContract]
    public class TinTucDTO
    {
        #region Thuộc tính
        private int maTin;
        private string tieuDe;
        private string nguoiDung;
        private string noiDung;
        private int tinhTrang;
        #endregion Thuộc tính

        #region Hàm Getter/Setter
        [DataMember]
        public int MaTin
        {
            get { return maTin; }
            set { maTin = value; }
        }

        [DataMember]
        public string TieuDe
        {
            get { return tieuDe; }
            set { tieuDe = value; }
        }
        [DataMember]
        public string NguoiDung
        {
            get { return nguoiDung; }
            set { nguoiDung = value; }
        }
        [DataMember]
        public string NoiDung
        {
            get { return noiDung; }
            set { noiDung = value; }
        }
        [DataMember]
        public int TinhTrang
        {
            get { return tinhTrang; }
            set { tinhTrang = value; }
        }
        #endregion Getter/Setter

        #region Các hàm khởi tạo
        public TinTucDTO()
        {
            this.maTin = 0;
            this.tieuDe = "";
            this.nguoiDung = "";
            this.noiDung = "";
            this.tinhTrang = 0;
        }
        public TinTucDTO(TinTucDTO tt)
        {
            this.maTin = tt.maTin;
            this.tieuDe = tt.tieuDe;
            this.nguoiDung = tt.nguoiDung;
            this.noiDung = tt.noiDung;
            this.tinhTrang = tt.tinhTrang;
        }

        public TinTucDTO(int _ma, string _tieuDe, string _nguoiDung, string _noiDung, int _tinhTrang)
        {
            this.maTin = _ma;
            this.tieuDe = _tieuDe;
            this.nguoiDung = _nguoiDung;
            this.noiDung = _noiDung;
            this.tinhTrang = _tinhTrang;
        }
        #endregion Khởi tạo
    }
}